/**
 * Created with IntelliJ IDEA.
 * User: Sunny
 * Date: 21/09/13
 * Time: 05:18
 * To change this template use File | Settings | File Templates.
 */
public class Test {

    public int[]a;
    public int[]b;

    public static void sum(int a[], int b[]){
           if(a.length != b.length) {
               throw new ArrayStoreException("Error");
           }

           int res[] = new int[a.length];

        for(int i =0; i< a.length; i++) {
          //for(int j =0; j<b.length; j++){
             res[i] = a[i] + b[i];

            System.out.print(res[i]+ " ");
          }}


    public static void main(String[] args) {
        int []a={1,1};
        int []b ={2,2};
        sum(a,b);
    }
}
